<?php
class Model_CCMISDepartment extends CCMIS_Model {
    //Database ccmis_department

    public function __construct(){
        parent::__construct();
        $this->load->database();
    }

    public function getAll()
    {
        $sql = "SELECT * FROM ccmis_department";
        $query =  $this->db->query($sql);
        $result = $query->result_array();
        return $result;
    }

    public function getDescById($id)
    {
        $sql = "SELECT DepartmentDescription FROM ccmis_department WHERE DepartmentID LIKE ?";
        $query =  $this->db->query($sql, $id);
        $result = $query->row();
        return $result->DepartmentDescription;
    }

    public function getById($id)
    {
        $sql = "SELECT * FROM ccmis_department WHERE DepartmentID LIKE ?";
        $query =  $this->db->query($sql, $id);
        $result = $query->result_array();
        return $result;
    }

}
